/*
 * Copyright (c) 2021. Moses All Right Reserved
 */

package com.moses.design_patterns.factory_method.a;

import com.moses.design_patterns.factory_method.IProduct;

/**
 * @author Moses
 * @email shenhuohui@gmail.com
 * @date 2021/4/9 21:46
 */
public class SimpleFactory {

    public IProduct getProduct(Class clz){
        IProduct iProduct = null;
        try {
            iProduct = (IProduct) clz.newInstance();
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
        return iProduct;
    }
}
